<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <title>Geeklog Documentation - Links Plugin</title>
  <link rel="stylesheet" type="text/css" href="../docstyle.css" title="Dev Stylesheet">
</head>

<body>
<p><a href="http://www.geeklog.net/" style="background:transparent"><img src="../images/newlogo.gif" alt="Geeklog" width="243" height="90"></a></p>
<div class="menu"><a href="index.html">Geeklog Documentation</a> - Links Plugin</div>

<h1>Links Plugin</h1>

<p>The links section used to be an integral part of the Geeklog core code, but have been moved to a plugin as of Geeklog 1.4.0.</p>

<h2><a name="config.php">Configuration</a></h2>

<p>The configuration of the Links plugin can be changed from the Configuration admin panel:</p>

<h3><a name="public">Public Links List Settings</a></h3>

<table>
<tr><th style="width:25%">Variable</th>
    <th style="width:25%">Default Value</th>
    <th style="width:50%">Description</th>
</tr>
<tr>
  <td><a name="desc_linksloginrequired">linksloginrequired</a></td>
  <td>0</td>
  <td>When set to 1, only registered users can access the links section.<br>
    Please note that <code>$_CONF['<a
    href="config.html#desc_loginrequired">loginrequired</a>']</code> in
    Geeklog's main configuration takes precedence over this setting. So when
    <code>'loginrequired'</code> is set to 1, anonymous users can not access
    the links section even when <code>'linksloginrequired'</code> is set
    to 0.</td>
</tr>
<tr class="r2">
  <td><a name="desc_linkcols">linkcols</a></td>
  <td>3</td>
  <td>The number of link categories to display per column.</td>
</tr>
<tr>
  <td><a name="desc_linksperpage">linksperpage</a></td>
  <td>10</td>
  <td>The number of links to show per page.</td>
</tr>
<tr class="r2">
  <td><a name="desc_show_top10">show_top10</a></td>
  <td><code>true</code></td>
  <td>When both <code>$_LI_CONF['linkcols']</code> and
    <code>$_LI_CONF['linksperpage']</code> are <em>not</em> 0, the plugin will
    show a list of the 10 most clicked-on links on the Links plugin's index
    page automatically. If you do not want that "top 10" list there, set this
    option to <code>false</code>.</td>
</tr>
<tr>
  <td><a name="desc_show_category_descriptions">show_category_descriptions</a></td>
  <td><code>true</code></td>
  <td>Whether to show subcategory descriptions when viewing a category or not.</td>
</tr>
<tr class="r2">
  <td><a name="desc_new_window">new_window</a></td>
  <td><code>false</code></td>
  <td>Whether to open external links in a new window or not.<br>
  <strong>Note:</strong> Use this option with care. <a
    href="http://diveintoaccessibility.org/day_16_not_opening_new_windows.html">It takes control away</a> from your users and may confuse or annoy them.</td>
</tr>
</table>

<h3><a name="admin">Links Admin Settings</a></h3>

<table>
<tr><th style="width:25%">Variable</th>
    <th style="width:25%">Default Value</th>
    <th style="width:50%">Description</th>
</tr>
<tr>
  <td><a name="desc_hidenewlinks">hidenewlinks</a></td>
  <td>0</td>
  <td>Whether new links should be hidden from the "What's New" block (when set
    = 1) or whether to list them there (when set to = 0).</td>
</tr>
<tr class="r2">
  <td><a name="desc_newlinksinterval">newlinksinterval</a></td>
  <td>1209600</td>
  <td>For how long a link should be considered "new" and show up in the "What's
    New" block on the site. The interval is given in seconds, so the default
    value equals 14 days.</td>
</tr>
<tr>
  <td><a name="desc_hidelinksmenu">hidelinksmenu</a></td>
  <td>0</td>
  <td>Whether to hide the "Links" entry from Geeklog's menu bar (when set to 1)
    or to show it (when set to 0).</td>
</tr>
<tr class="r2">
  <td><a name="desc_linksubmission">linksubmission</a></td>
  <td>1</td>
  <td>Whether links submitted by users will have to be approved by an admin
    first (when set = 1) or show up immediately (when set = 0).</td>
</tr>
<tr>
  <td><a name="desc_notification">notification</a></td>
  <td>0</td>
  <td>Whether to send an email notification when a new link was submitted (when
    set to = 1) or not (when set to = 0).</td>
</tr>
<tr class="r2">
  <td><a name="desc_delete_links">delete_links</a></td>
  <td>0</td>
  <td>Defines what to do when a user is deleted that is the owner of a link.
    When set to 0, all links owned by the deleted user will be assigned to a
    user of the "Root" group (e.g. the site admin). When set to 1, the links
    are deleted.</td>
</tr>
<tr>
  <td><a name="desc_aftersave">aftersave</a></td>
  <td>'list'</td>
  <td>Which page to go to after a links has been saved:
    <ul>
    <li>'item': go to the linked site(!)</li>
    <li>'list': show admin's list of links (default)</li>
    <li>'plugin': display the public list of links</li>
    <li>'home': display the site's homepage</li>
    <li>'admin': go to the "Admin Home" page, i.e. Command &amp; Control</li>
    </ul></td>
</tr>
<tr class="r2">
  <td><a name="desc_root">root</a></td>
  <td>'site'</td>
  <td>ID to use for the root of the link categories tree.</td>
</tr>
</table>


<h2><a name="layout">Layout of the Links plugin's index page</a></h2>

<p>The general layout of the index page of the Links plugin is defined by the
options <code>$_LI_CONF['linkcols']</code> and <code>$_LI_CONF['linksperpage']</code>, as explained above.</p>

<p>If you'd rather have a straight list of all your links, you can set both
of these options to 0. This probably makes the most sense when you only have
a few links. Setting only <code>$_LI_CONF['linksperpage']</code> to 0 zero will
list all the links of the current category on one page. Setting only
<code>$_LI_CONF['linkcols']</code> to 0 will hide the categories and will
display all your links spread over several pages.</p>


<h3><a name="templates">Template files</a></h3>

<p>To further change the layout of your Links section, you can change the
template files. Please note that they are now located in the plugin's directory,
i.e. in</p>
<p style="margin-left:4em;"><tt>/path/to/geeklog/plugins/links/templates/</tt></p>
<p>If you're using a theme that was made for an older version of Geeklog (prior
to Geeklog 1.4.0), you may still have a "links" directory in your theme's
directory - but that is not used any more and can be safely removed.</p>


<h2><a name="autotags">Autotags</a></h2>

<p>The Links Plugin provides one <a href="http://www.geeklog.net/article.php/autolinks" title="geeklog.net: About Autolinks and Autotags">autotag</a>,
<code>[link:]</code>. You can use this autotag to embed one of the links from
your site's Links section into an article or a comment (amongst other things)
without having to type out the full URL. Simply add the link's ID after the
colon. It will then create a link to the site in question and use the link's
title as the link text. Alternatively, you can add your own link text after the
ID (but before the closing bracket).</p>

<p>For example, on geeklog.net:</p>
<ul>
<li><code>[link:20030921074903113]</code> will be translated to: <code>&lt;a href="http://www.geeklog.net/links/portal.php/link/20030921074903113"&gt;Groklaw&lt;/a&gt;</code></li>
<li><code>[event:20030921074903113 read everything about the SCO case]</code> will be translated to: <code>&lt;a href="http://www.geeklog.net/links/portal.php/link/20030921074903113"&gt;read everything about the SCO case&lt;/a&gt;</code></li>
</ul>

<p>Note that the <code>[link:]</code> autotag will always create links that go
through Geeklog's <tt>portal.php</tt> script so that the number of clicks on
that link can be counted.</p>


<div class="footer">
    <a href="http://wiki.geeklog.net/">The Geeklog Documentation Project</a><br>
    All trademarks and copyrights on this page are owned by their respective owners. Geeklog is copyleft.
</div>

</body>
</html>
